package com.gupao.javap6.schemadesign.factory;

import com.gupao.javap6.schemadesign.service.OutPayService;

/**
 * 国外支付工厂
 *
 * @author withinfly(45度C)
 * @date 2020/2/24 22:13
 */
public final class OutPaymentFactory {
    protected OutPaymentFactory(){}
    public <T extends OutPayService> T creating(Class<T> clazz){
        try {
            T outPayService = clazz.newInstance();
            return outPayService;
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
